package main

import (
	"fmt"
	"math/rand"
)

func main() {
	//打印九九乘法表
	for i := 1; i < 10; i++ {
		for j := 1; j <= i; j++ {
			fmt.Printf("%vx%v=%v \t", j, i, i*j)
		}
		fmt.Printf("\n")
	}

	//随机数，偶数累乘，奇数累加
	var num1 int = 1
	var num2 int = 0
	for i := 0; i < 20; i++ {
		r := rand.Intn(20) + 1
		fmt.Printf("%d,", r)
		if r%2 == 0 {
			num1 = num1 * r
		} else {
			num2 = num2 + r
		}
	}
	fmt.Printf("偶数积是%v， 奇数和是%v", num1, num2)

}
